import Vue from 'vue';
import Vuex from 'vuex';
import createLogger from 'vuex/dist/logger';

Vue.use(Vuex);//z注册插件

export default new Vuex.Store({
  plugins:[createLogger()],
  state:{//==data{}
      age:'',
      email:'',
      id:'',
      name:'登录',
      entrytime:'',
      jobnum:'',
      image:'',
      x:''
  },
  mutations:{//==methods  state==this
    increatment(state, n){
      state.x = n;
    },
    btnChangeUser(state ,uAge, uEmail, uId, uName, uEntrytime, uJobnum, uImage){
      state.age = uAge;
      state.email = uEmail;
      state.id = uId;
      state.name = uName;
      state.entrytime = uEntrytime;
      state.jobnum = uJobnum;
      state.image = uImage;
      // console.log(state.name);
    }

  }
})
